#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/extensions/TestFactoryRegistry.h"
#include "cppunit/ui/text/TestRunner.h"

#include <qapplication.h>
#include "window.moc"
#include "glwidget.h"
#include "ucdinputfile.h"
#include "visKMeans.h"

using namespace visualization;
string filename;

class viskmeansTest : public CppUnit::TestFixture
{
	CPPUNIT_TEST_SUITE(ViskmeansTest);
	  CPPUNIT_TEST(testAccess);
		CPPUNIT_TEST(testSim);
		CPPUNIT_TEST(testInit);
		CPPUNIT_TEST(testMatrixMultiply);
		CPPUNIT_TEST(testSort);
		CPPUNIT_TEST(testGetEigenVec);
	CPPUNIT_TEST_SUITE_END();
	
public :
	viskmeansTest(){}
	~viskmeansTest(){}

	void setup(){}
	void tearDown(){}

	void testAccess();
	void testSim();
	void testInit();
	void testMatrixMultiply();
	void testSort();
	void testGetEigenVec();

private:
	visKMeans visKM;
	Model t;
};

CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(viskmeansTest, "kmeanstest");

void viskmeansTest::testAccess()
{

}
void viskmeansTest::testSim()
{
	UCDInputFile file(filename);

	if(file.FGetModel(t) != 0)
	{
		exit(-1);
	}
	t.buildKDTree();

}
void viskmeansTest::testInit()
{

}
void viskmeansTest::testMatrixMultiply()
{

}
void viskmeansTest::testSort()
{

}
void viskmeansTest::testGetEigenVec()
{

}

int main(int argc, char *argv[])
{
	cout << "Input the data file: " << endl;
	cin >> filename;

	CppUnit::TextUi::TestRunner runner;
	CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry("kmeanstest");
	runner.addTest(registry.makeTest());
	runner.run();
	return 0;
}

